package com.example.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.pojo.clerkNamePojo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface clerkNameMapp {
    @DS("newMscLowCodeTest")
    @Insert("INSERT INTO ddm_clerk_name (" +
            "id, create_time, update_time, creator, process_status, sys_update_user, " +
            "sys_audit_user, sys_audit_time, sys_deleted, serial_number, name, department, " +
            "section, position, shift, employeeNumber, gender, homeAddress, phone, " +
            "birthDate, maritalStatus, children, commute, hireDate, photo, reason, leavingData, " +
            "cabinetKey, gloveSize, vacationBeginOne, vacationEndOne, vacationBeginTwo, vacationEndTwo, " +
            "vacationBeginThree, vacationEndThree" +
            ") VALUES (" +
            "#{id}, #{create_time}, #{update_time}, #{creator}, #{process_status}, #{sys_update_user}, " +
            "#{sys_audit_user}, #{sys_audit_time}, #{sys_deleted}, #{serial_number}, #{name}, #{department}, " +
            "#{section}, #{position}, #{shift}, #{employeeNumber}, #{gender}, #{homeAddress}, #{phone}, " +
            "#{birthDate}, #{maritalStatus}, #{children}, #{commute}, #{hireDate}, #{photo}, #{reason}, #{leavingData}, " +
            "#{cabinetKey}, #{gloveSize}, #{vacationBeginOne}, #{vacationEndOne}, #{vacationBeginTwo}, #{vacationEndTwo}, " +
            "#{vacationBeginThree}, #{vacationEndThree}" +
            ")")
    void insertOne(clerkNamePojo clerkNamePojo);

    @DS("newMscLowCodeTest")
    @Select("select * from ddm_clerk_name where sys_deleted=0")
    List<clerkNamePojo> queryAll();

    @DS("newMscLowCodeTest")
    @Update("UPDATE ddm_clerk_name SET " +
            "update_time = #{update_time}, " +
            "name = #{name}, " +
            "department = #{department}, " +
            "section = #{section}, " +
            "position = #{position}, " +
            "shift = #{shift}, " +
            "employeeNumber = #{employeeNumber}, " +
            "gender = #{gender}, " +
            "homeAddress = #{homeAddress}, " +
            "phone = #{phone}, " +
            "maritalStatus = #{maritalStatus}, " +
            "children = #{children}, " +
            "commute = #{commute}, " +
            "hireDate = #{hireDate}, " +
            "photo = #{photo}, " +
            "reason = #{reason}, " +
            "leavingData = #{leavingData}, " +
            "cabinetKey = #{cabinetKey}, " +
            "gloveSize = #{gloveSize}, " +
            "vacationBeginOne = #{vacationBeginOne}, " +
            "vacationEndOne = #{vacationEndOne}, " +
            "vacationBeginTwo = #{vacationBeginTwo}, " +
            "vacationEndTwo = #{vacationEndTwo}, " +
            "vacationBeginThree = #{vacationBeginThree}, " +
            "vacationEndThree = #{vacationEndThree} " +
            "WHERE id = #{id} AND sys_deleted = 0")
    void updateClerkName(clerkNamePojo clerkNamePojo);
}
